object = System.Object
Type = System.Type
Object = UnityEngine.Object
GameObject = UnityEngine.GameObject
Transform = UnityEngine.Transform
MonoBehaviour = UnityEngine.MonoBehaviour
Component = UnityEngine.Component
Application = UnityEngine.Application
SystemInfo = UnityEngine.SystemInfo
Screen = UnityEngine.Screen
Camera = UnityEngine.Camera
Material = UnityEngine.Material
Renderer = UnityEngine.Renderer
AsyncOperation = UnityEngine.AsyncOperation

CharacterController = UnityEngine.CharacterController
SkinnedMeshRenderer = UnityEngine.SkinnedMeshRenderer
Animation = UnityEngine.Animation
AnimationClip = UnityEngine.AnimationClip
AnimationEvent = UnityEngine.AnimationEvent
AnimationState = UnityEngine.AnimationState
Input = UnityEngine.Input
KeyCode = UnityEngine.KeyCode
AudioClip = UnityEngine.AudioClip
AudioSource = UnityEngine.AudioSource
Physics = UnityEngine.Physics
Light = UnityEngine.Light
LightType = UnityEngine.LightType
ParticleEmitter = UnityEngine.ParticleEmitter
Space = UnityEngine.Space
CameraClearFlags = UnityEngine.CameraClearFlags
RenderSettings = UnityEngine.RenderSettings
MeshRenderer = UnityEngine.MeshRenderer
WrapMode = UnityEngine.WrapMode
QueueMode = UnityEngine.QueueMode
PlayMode = UnityEngine.PlayMode
ParticleAnimator = UnityEngine.ParticleAnimator
TouchPhase = UnityEngine.TouchPhase
AnimationBlendMode = UnityEngine.AnimationBlendMode
Rect = UnityEngine.Rect
Time = UnityEngine.Time

--unity 对象判断为空, 如果你有些对象是在c#删掉了，lua 不知道
--判断这种对象为空时可以用下面这个函数。
function IsNil(uobj)
    return uobj == nil or uobj:Equals(nil)
end

-- IsNan
function IsNan(number)
    return not (number == number)
end

function IsSet(hashtable, key)
    local t = type(hashtable)
    local b = (t == "table" or t == "userdata");
    return b and hashtable[key] ~= nil
end

function GetDir(path)
    return string.match(fullpath, ".*/")
end

function GetFileName(path)
    return string.match(fullpath, ".*/(.*)")
end

function checknumber(value, base)
    return tonumber(value, base) or 0
end

function checkint(value)
    return math.round(checknumber(value))
end

function checkbool(value)
    return (value ~= nil and value ~= false)
end

function checktable(value)
    if type(value) ~= "table" then value = {} end
    return value
end

function handler(obj, method)
    return function(...)
        return method(obj, ...)
    end
end

--重新require一个lua文件，替代系统文件。
function reimport(name)
    local package = package
    package.loaded[name] = nil
    package.preload[name] = nil
    return require(name)    
end